package com.atguigu.gmall.all.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author mqx
 * @date 2020-10-19 09:38:19
 */
@Controller
public class PassportController {

    //  用户点击登录：
    //  'http://passport.gmall.com/login.html?originUrl='+window.location.href
    //  如果在首页点击登录时：http://passport.gmall.com/login.html?originUrl=http://www.gmall.com
    @GetMapping("login.html")
    public String login(HttpServletRequest request){
        //  logo.html originUrl: [[${originUrl}]]
        String originUrl = request.getParameter("originUrl");
        request.setAttribute("originUrl",originUrl);
        // 返回登录页面
        return "login";
    }

}
